package com.xhwl.centiotdata.service.cent;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhwl.common.dto.auth.AuthDeviceDTO;
import com.xhwl.common.dto.auth.PedestrianAuthDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.auth.AuthAccountMapping;
import com.xhwl.common.pojo.cent.auth.CardInfo;
import com.xhwl.common.pojo.cent.auth.TransitionCardInfo;
import com.xhwl.common.query.cent.auth.AuthDeviceQuery;
import com.xhwl.common.vo.cent.auth.CardOfUserVO;
import feign.Param;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;

/**
 * @Author: yanyixiong
 * @Description:
 * @Date: create in 15:13 2022/3/9
 */
@FeignClient(value = "cent-auth")
public interface IAuthAccountCentService {

    @RequestLine(value = "POST /card-info-core/query-account-id")
    Page<CardInfo> getUserCardDetailByUserid(@Param("cardOfUserVo") CardOfUserVO cardOfUserVo);

    @RequestLine(value = "POST /auth-service/save-card")
    ResultJson saveCardOnly(@Param("pedestrianAuthDTO") PedestrianAuthDTO pedestrianAuthDTO);

    @RequestLine(value = "POST /account-mapping-core/query-open-id")
    String queryOpenId(@Param("projectId") Integer projectId,
                       @Param("accountId") Integer accountId,
                       @Param("openId") String openId,
                       @Param("productId") Integer productId);

    @RequestLine(value = "POST /account-mapping-core/queryOpenIdbyCard")
    String queryOpenIdbyCard(@Param("projectId") Integer projectId,
                             @Param("card") String card
                            );


    @RequestLine(value = "POST /account-mapping-core/save")
    boolean save(@Param("projectId") Integer projectId,
                @Param("accountId") Integer accountId,
                @Param("openId") String openId,
                @Param("openCode") String openCode,
                @Param("productId") Integer productId);

    @RequestLine(value = "POST /account-mapping-core/query")
    AuthAccountMapping query(@Param("projectId") Integer projectId,
                             @Param("accountId") Integer accountId,
                             @Param("productId") Integer productId);

    @RequestLine(value = "POST /account-mapping-core/list-by-openid")
    List<AuthAccountMapping> listByOpenIds(@Param("openIds") List<String> openIds);

    @RequestLine(value = "POST /account-mapping-core/list")
    List<AuthAccountMapping> list(@Param("projectId") Integer projectId,
                                  @Param("accountId") Integer accountId,
                                  @Param("productId") Integer productId);

    @RequestLine(value = "POST /auth-service/save-transition-card")
    ResultJson saveTransitionCard(@Param("transitionCardInfo") TransitionCardInfo transitionCardInfo);

    @RequestLine(value = "POST /auth-service/save-transition-cards")
    ResultJson saveTransitionCards(@Param("transitionCardInfos") List<TransitionCardInfo> transitionCardInfo);

    @RequestLine(value = "POST /account-mapping-core/delete")
    boolean deleteAccountMapping(@Param("projectId") Integer projectId, @Param("accountId") Integer accountId, @Param("openId") String openId, @Param("productId") Integer productId);

    @RequestLine(value = "POST /account-mapping-core/list-by-openCode")
    List<AuthAccountMapping> listByOpenCode(@Param("openCodes") List<String> openCodes);


    @RequestLine("POST /authorized-devices")
    ResultJson getAuthorizedDevice(@Param("industryId") Short industryId, @Param("accountId") Integer accountId);


    @RequestLine("POST /card-info-core/delete")
    Integer deleteByAccount(@Param("accountId") Integer accountId);

    /**
     * 查询业务授权信息
     * */
    @RequestLine("POST /list-object-with-info")
    List<AuthDeviceDTO> listObjectWithInfo(@Param("authDeviceQuery") AuthDeviceQuery authDeviceQuery);

    /**
     * 同步第三方授权设备信息到兴海系统
     *
     * @param pedestrianAuthDTOList 第三人员id与第三方人员设备关系表
     */
    @RequestLine(value = "POST /auth-pedestrian-service/sync-third-authorized")
    ResultJson syncThirdAuthorizedInfo(@Param("pedestrianAuthDTOList") List<PedestrianAuthDTO> pedestrianAuthDTOList);

}
